package me.a04test;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Test1 {
    public static void main(String[] args) {
        //随机点名
        ArrayList<String> list = new ArrayList<>();

        Collections.addAll(list, "沙瑞金", "田国富", "祁同伟", "高植物", "李达康");

        //随机点名1
        /*Random r = new Random();
        int index = r.nextInt(list.size());
        String name = list.get(index);
        System.out.println(name);*/

        //随机点名2，通过打乱数据
        Collections.shuffle(list);
        String name = list.get(0);
        System.out.println(name);
    }
}
